This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
ARM64: Enable Struct Promotion for most Mutireg structs #4632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enable struct promotion for Multireg Struct on Arm64 (16-byte structs)
For the current level of support the struct must have exactly two fields and they must be on the natural alignment of 0 and 8.
If the struct is use as a parameter and it contains a floating point field then we force the promoted struct to be stack allocated in order to avoid LSRA limitations in this area.
If a promoted multireg struct is passed in the out going arg area we convert it to the GT_LIST form.
The optimizer phases can perform copy and constant prop into the promoted struct fields.
Support for the promotion of incoming multireg arguments is still disabled as additional work in required to enable this.
A lot of method showed very large improvemenst is the AsmDiffs.
Overall using we are seeing a 0.34% total size improvement with a lot of method showing 50% size reductions:
mscorlib.dasm 6852660 6831248 21412 0.31 38763
573 functions improved (19428 total bytes improvement)
Improvement # 1 goes from 3428 to 2216, diff of 1212 (35.36%) :: System.Runtime.Remoting.Activation.RemotingXmlConfigFileParser:ParseDefaultConfiguration():ref
Improvement # 2 goes from 996 to 584, diff of 412 (41.37%) :: System.BCLDebug:.cctor()
Improvement # 3 goes from 184 to 60, diff of 124 (67.39%) :: System.Internal:NullableHelper():long
Improvement # 4 goes from 540 to 332, diff of 208 (38.52%) :: System.Decimal:.cctor()
Improvement # 5 goes from 292 to 144, diff of 148 (50.68%) :: System.Internal:NullableHelper():ref
Improvement # 6 goes from 104 to 28, diff of 76 (73.08%) :: System.ConfigNode:ReplaceAttribute(int,ref,ref):this
Improvement # 7 goes from 144 to 60, diff of 84 (58.33%) :: System.Collections.Generic.Dictionary`2[EventCacheKey,EventCacheEntry][System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal+NativeOrStaticEventRegistrationImpl+EventCacheKey,System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMarshal+NativeOrStaticEventRegistrationImpl+EventCacheEntry]:System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(struct):this
Improvement # 8 goes from 184 to 92, diff of 92 (50.00%) :: System.Threading.CancellationTokenRegistration:Equals(struct):bool:this
Improvement # 9 goes from 148 to 72, diff of 76 (51.35%) :: System.Threading.Tasks.ParallelLoopStateFlags64:get_NullableLowestBreakIteration():struct:this
Improvement #10 goes from 96 to 36, diff of 60 (62.50%) :: System.Runtime.CompilerServices.ConfiguredTaskAwaitable:.ctor(ref,bool):this